#include "device_config.h"
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "basic_config.h"
#include "common_log.h"
#include "transcode.h"

void ReadHttpConf(const char *path, t_Http *http) {
	GetPrivateProfileString("http", "ip", "", http->ip, sizeof(http->ip), path);
	http->port = GetPrivateProfileInt("http", "port", 0, path);
	GetPrivateProfileString("http", "token", "", http->token, sizeof(http->token), path);
	GetPrivateProfileString("http", "username", "", http->username, sizeof(http->username), path);
	GetPrivateProfileString("http", "password", "", http->password, sizeof(http->password), path);	
}

void PrintHttpConf(const t_Http *http) {
	LOGINFO("[http]%s,%d,%s,%s,%s\n", http->ip, http->port, http->token, http->username, http->password);
	printf("[http]%s,%d,%s,%s,%s\n", http->ip, http->port, http->token, http->username, http->password);	
}

